<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/1/15
 * Time: 23:05
 */
namespace app\admin\logic\transfer_driver;
use think\exception\ValidateException;


/**
 * 打款上层服务
 */
class Driver
{
    static $config = [
        'tl' => '\\app\\admin\\logic\\transfer_driver\\Tl',
        'alipay' => '\\app\\admin\\logic\\transfer_driver\\Ali'
    ];
    public static function getDriver($type) {
        switch ($type) {
            case 'tl': return (new self::$config['tl']);
            case 'alipay': return self::$config['alipay']::instance();
            default: throw new ValidateException('未定义该打款方式');
        }
    }
}